Optimal. Leaf size=182 \[ -\frac{b (d \cot (e+f x))^{n+2} \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\cot ^2(e+f x)\right )}{d^2 f (n+2) \left (a^2+b^2\right )}+\frac{a (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac{n+3}{2};\frac{n+5}{2};-\cot ^2(e+f x)\right )}{d^3 f (n+3) \left (a^2+b^2\right )}-\frac{a^2 (d \cot (e+f x))^{n+2} \, _2F_1\left (1,n+2;n+3;-\frac{a \cot (e+f x)}{b}\right )}{b d^2 f (n+2) \left (a^2+b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.389639, antiderivative size = 182, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 7, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.304, Rules used = {3673, 3574, 3538, 3476, 364, 3634, 64} \[ -\frac{b (d \cot (e+f x))^{n+2} \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\cot ^2(e+f x)\right )}{d^2 f (n+2) \left (a^2+b^2\right )}+\frac{a (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac{n+3}{2};\frac{n+5}{2};-\cot ^2(e+f x)\right )}{d^3 f (n+3) \left (a^2+b^2\right )}-\frac{a^2 (d \cot (e+f x))^{n+2} \, _2F_1\left (1,n+2;n+3;-\frac{a \cot (e+f x)}{b}\right )}{b d^2 f (n+2) \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3673
Rule 3574
Rule 3538
Rule 3476
Rule 364
Rule 3634
Rule 64
Rubi steps
\begin{align*} \int \frac{(d \cot (e+f x))^n}{a+b \tan (e+f x)} \, dx &=\frac{\int \frac{(d \cot (e+f x))^{1+n}}{b+a \cot (e+f x)} \, dx}{d}\\ &=\frac{\int (d \cot (e+f x))^{1+n} (b-a \cot (e+f x)) \, dx}{\left (a^2+b^2\right ) d}+\frac{a^2 \int \frac{(d \cot (e+f x))^{1+n} \left (1+\cot ^2(e+f x)\right )}{b+a \cot (e+f x)} \, dx}{\left (a^2+b^2\right ) d}\\ &=-\frac{a \int (d \cot (e+f x))^{2+n} \, dx}{\left (a^2+b^2\right ) d^2}+\frac{b \int (d \cot (e+f x))^{1+n} \, dx}{\left (a^2+b^2\right ) d}+\frac{a^2 \operatorname{Subst}\left (\int \frac{(-d x)^{1+n}}{b-a x} \, dx,x,-\cot (e+f x)\right )}{\left (a^2+b^2\right ) d f}\\ &=-\frac{a^2 (d \cot (e+f x))^{2+n} \, _2F_1\left (1,2+n;3+n;-\frac{a \cot (e+f x)}{b}\right )}{b \left (a^2+b^2\right ) d^2 f (2+n)}-\frac{b \operatorname{Subst}\left (\int \frac{x^{1+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{\left (a^2+b^2\right ) f}+\frac{a \operatorname{Subst}\left (\int \frac{x^{2+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{\left (a^2+b^2\right ) d f}\\ &=-\frac{b (d \cot (e+f x))^{2+n} \, _2F_1\left (1,\frac{2+n}{2};\frac{4+n}{2};-\cot ^2(e+f x)\right )}{\left (a^2+b^2\right ) d^2 f (2+n)}-\frac{a^2 (d \cot (e+f x))^{2+n} \, _2F_1\left (1,2+n;3+n;-\frac{a \cot (e+f x)}{b}\right )}{b \left (a^2+b^2\right ) d^2 f (2+n)}+\frac{a (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac{3+n}{2};\frac{5+n}{2};-\cot ^2(e+f x)\right )}{\left (a^2+b^2\right ) d^3 f (3+n)}\\ \end{align*}
Mathematica [A] time = 0.537, size = 145, normalized size = 0.8 \[ -\frac{\cot ^2(e+f x) (d \cot (e+f x))^n \left (a \left (a (n+3) \, _2F_1\left (1,n+2;n+3;-\frac{a \cot (e+f x)}{b}\right )-b (n+2) \cot (e+f x) \, _2F_1\left (1,\frac{n+3}{2};\frac{n+5}{2};-\cot ^2(e+f x)\right )\right )+b^2 (n+3) \, _2F_1\left (1,\frac{n+2}{2};\frac{n+4}{2};-\cot ^2(e+f x)\right )\right )}{b f (n+2) (n+3) \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.224, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d\cot \left ( fx+e \right ) \right ) ^{n}}{a+b\tan \left ( fx+e \right ) }}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \cot \left (f x + e\right )\right )^{n}}{b \tan \left (f x + e\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{\left (d \cot \left (f x + e\right )\right )^{n}}{b \tan \left (f x + e\right ) + a}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \cot{\left (e + f x \right )}\right )^{n}}{a + b \tan{\left (e + f x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (d \cot \left (f x + e\right )\right )^{n}}{b \tan \left (f x + e\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]